package com.camp.socialtong.dao;

import java.util.List;

import org.springframework.dao.DataAccessException;
import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport;

import com.camp.socialtong.model.CalendarScheduleModel;

public class CalendarScheduleDAOImpl  extends SqlMapClientDaoSupport implements CalendarScheduleDAO{

	public void setQueryContext(String queryContext) {
		this.queryContext = queryContext;
	}

	String queryContext;
	
	public List selectSchedulesBySomeConditions(
			CalendarScheduleModel calendarScheduleModel)
			throws DataAccessException {
		// TODO Auto-generated method stub
		return getSqlMapClientTemplate().queryForList(queryContext + ".selectSchedulesBySomeConditionsForFullCalendar", calendarScheduleModel);
	}

	public List selectSchedule(CalendarScheduleModel calendarScheduleModel)
			throws DataAccessException {
		// TODO Auto-generated method stub
		return getSqlMapClientTemplate().queryForList(queryContext + ".selectSchedule");
	}

	public int makeSchedule(CalendarScheduleModel calendarScheduleModel)
			throws DataAccessException {
		// TODO Auto-generated method stub
		return getSqlMapClientTemplate().update(queryContext + ".makeSchedule", calendarScheduleModel);
	}

	public int deleteSchedule(CalendarScheduleModel calendarScheduleModel)
			throws DataAccessException {
		// TODO Auto-generated method stub
		return getSqlMapClientTemplate().update(queryContext + ".deleteSchedule", calendarScheduleModel);
	}

}
